package com.tyk.bookstore.back.platform.model.vo;

import com.tyk.bookstore.back.common.core.model.page.PageVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @author tyk
 * @description 行政区域
 */
@Data
@Schema(name = "AreaPageVo", description = "行政区域")
public class AreaPageVo extends PageVo<AreaPageVo.Area> {

    @Data
    @Schema(name = "Area", description = "行政区域")
    public static class Area implements Serializable {

        @Serial
        private static final long serialVersionUID = 1L;

        @Schema(description = "行政区划代码")
        private Long code;

        @Schema(description = "父级行政区划代码")
        private Long parentCode;

        @Schema(description = "名称")
        private String name;

        @Schema(description = "是否拥有子结点")
        private Boolean hasChildren = true;

        @Schema(description = "子结点")
        private List<Area> children;
    }
}
